package demo1;

public class MainClass {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.eat();
        dog.bark();
        Cat cat = new Cat();
        cat.sleep();
        cat.mew();
        //继承了Animal类的成员变量和成员方法，可以调用

        Base b = new Base();
        Derived d = new Derived();
        d.methodC();

        //实例化子类，调用子类的构造方法
        Students s = new Students("张三", 18, "3班");
        s.print();
    }
}
